<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/" py:strip="" onload='closeFrame();'>

    <py:match path="head" once="true">
        <head py:attrs="select('@*')">
            <title py:with="title = list(select('title/text()'))">
                <py:if test="title">${title}</py:if>
            </title>
            <link rel="icon" href="/static/_renewed_static/images/favicon.ico" type="image/png" />
            <meta content="text/html; charset=UTF-8" http-equiv="content-type" />

            <!-- Stylesheets -->
            <link type="text/css" rel="stylesheet" media="screen" href="/static/_renewed_static/css/tabber.css"></link>
            <link type="text/css" rel="stylesheet" media="print" href="/static/_renewed_static/css/print.css"></link>
            <link type="text/css" rel="stylesheet" href="/static/_renewed_static/css/autocomplete.css"></link>
            <link type="text/css" rel="stylesheet" href="/static/_renewed_static/css/style.css"></link>
            <link type="text/css" rel="stylesheet" href="/static/_renewed_static/css/menu.css"></link>
            <link type="text/css" rel="stylesheet" href="/static/_renewed_static/css/sortable.css"></link>
            <link type="text/css" rel="stylesheet" href="/static/_renewed_static/css/list.css"></link>
            <link type="text/css" rel="stylesheet" href="/tg_widgets/turbogears.widgets/calendar/calendar-win2k-cold-1.css"/>

            <!-- System JS -->
            <script type="text/javascript" src="/static/_renewed_static/javascript/MochiKit.js" ></script>
            <script type="text/javascript" src="/tg_widgets/turbogears.widgets/autocompletefield.js"></script>

            <!-- Tabber JS -->
            <script type="text/javascript" src="/tg_widgets/turbogears.widgets/tabber/tabber_cookie.js" ></script>
            <script type="text/javascript">
                function show()
                {
                    return window==top;
                }
            </script>
            <script type="text/javascript">
                no_items_selected_message = '${_("You need to select at least one record")}';
                
                try {
                   tabberOptions
                } catch(e) {
                   tabberOptions = {};
                }
                tabberOptions['onLoad'] = tabber_onload;
                tabberOptions['onClick'] = tabber_onclick;
                tabberOptions['cookie'] = 'TGTabber';
            </script>


            <!-- Calendar JS -->
            <script type="text/javascript" src="/tg_widgets/turbogears.widgets/calendar/calendar.js"></script>
            <script type="text/javascript" src="/tg_widgets/turbogears.widgets/calendar/calendar-setup.js"></script>
            <script type="text/javascript" src="/tg_widgets/turbogears.widgets/calendar/lang/calendar-ru.js"></script>

            <!-- Mnemoply simple JS -->
            <script type="text/javascript" src="/static/_renewed_static/javascript/menu.js"></script>
            <script type="text/javascript" src="/static/_renewed_static/javascript/utils.js"></script>
            <script type="text/javascript" src="/static/_renewed_static/javascript/sortable.js"></script>
            <script type="text/javascript" src="/static/_renewed_static/javascript/ajax.js"></script>

            <!-- Toolman sort and drag JS -->
            <script type="text/javascript" src="/static/_renewed_static/javascript/tool-man/core.js"></script>
            <script type="text/javascript" src="/static/_renewed_static/javascript/tool-man/events.js"></script>
            <script type="text/javascript" src="/static/_renewed_static/javascript/tool-man/css.js"></script>
            <script type="text/javascript" src="/static/_renewed_static/javascript/tool-man/coordinates.js"></script>
            <script type="text/javascript" src="/static/_renewed_static/javascript/tool-man/drag.js"></script>
            <script type="text/javascript" src="/static/_renewed_static/javascript/tool-man/dragsort.js"></script>
            <script type="text/javascript" src="/static/_renewed_static/javascript/tool-man/cookies.js"></script>

            ${select('*[local-name()!="title"]')}
        </head>
    </py:match>

<?python
    import datetime
    from turbogears.i18n import gettext as _
    from mnemoply.utils import parse_flash
    from mnemoply.widgets import Mainmenu
    

    april     = 4
    september = 9
    today     = datetime.date.today()
    is_summer = april <= today.month <= september
    groups    = tg.identity.groups
    menu_widget = Mainmenu()
?>

<py:match path="body">
<body py:attrs="select('@*')" onload='hideDiv();'>
    <script src="/tg_widgets/turbogears.widgets/tabber/tabber-minimized.js" type="text/javascript"></script>
    <div class='hide_in_iframe'>
        ${ET(menu_widget())}
    </div>
    <div id="wrap" class='hide_in_iframe'>
        <div id="pageLogin">
            <span py:if="tg.identity.anonymous">
                <a href="/login">Login</a>
            </span>
            <span py:if="not tg.identity.anonymous">
                <span>${tg.identity.user.display_name or tg.identity.user.user_name}</span>
                (<a href="/logout">Logout</a>)
            </span>
        </div>

        <pre py:if="tg_flash" class="flash" py:content="parse_flash(tg_flash)"> </pre>
    </div>
    <div class="center" id="content">
        <iframe  src = '' id = 'ifr' onload='hideDiv();'/>
        <div id="local-menu" py:if="defined('local_menu') and (len(local_menu) > 0)">
                <span py:for="mi in local_menu">
                    ${ET(mi.widget(**mi.params)())}
                </span>
                <div> <b>${ET(tg.back_widget())}</b></div>
        </div>
        <div>
             ${select("*")}
        </div>
     </div>
    <div id="footer"></div>

</body>
</py:match>

</html>
